package net.sx.minemodule.mvp.item;

import android.view.View;

import com.alibaba.android.arouter.launcher.ARouter;
import com.homegoods.aroutercomment.ARouterPath;
import com.kedll.library.mvp.BaseItem;

import net.sx.minemodule.R;
import net.sx.minemodule.mvp.bean.RefundGoodsBean;

public class AfterGoodsItem extends BaseItem<RefundGoodsBean> {
    public AfterGoodsItem(RefundGoodsBean data) {
        super(data);
    }

    @Override
    public int getLayout() {
        return R.layout.mine_item_mine_after_two;
    }

    public String getGoodsImgPath() {
        return getData().getPic();
    }

    public String getGoodsName() {
        return getData().getProductName();
    }

    public String getSpecification() {
        StringBuilder sbGoodsSpecification = new StringBuilder();
        if (getData().getAttrs()!=null) {
            for (RefundGoodsBean.AttrsBean a : getData().getAttrs()) {
                sbGoodsSpecification.append(a.getName()).append("：").append(a.getValue()).append(" ");
            }
        }
        sbGoodsSpecification.append("数量：x").append(getData().getNum());
        return sbGoodsSpecification.toString();
    }

    public void orderClick(View view) {
        ARouter.getInstance().build(ARouterPath.PATH_MINE_ORDER_DETAIL).navigation();
    }
}
